package com.newtouch.bxzs.database.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.newtouch.bxzs.common.base.model.CooperationCompanyParameter;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * CooperationCompanyParameterMapper的接口类
 *
 * <table border="1">
 * <tr>
 * <th>Date</th>
 * <th>Operator</th>
 * <th>Memo</th>
 * </tr>
 * <tr>
 * <td>2021/1/22 10:01</td>
 * <td>田尚柱</td>
 * <td>Create</td>
 * </tr>
 * </table>
 *
 * @author 田尚柱
 * @version 1.0.0
 */

@Mapper
public interface CooperationCompanyParameterMapper extends BaseMapper<CooperationCompanyParameter> {
    /**
     * 批量新增合作公司参数
     *
     * @param cooperationCompanyParameterList 合作公司参数VO集合
     */
    @Insert("<script>" +
            "INSERT INTO ASSISTANT_COOPERATION_COMPANY_PARAMETER (COOPERATION_COMPANY_PARAMETER_ID, COOPERATION_COMPANY_PARAMETER_CODE, COOPERATION_COMPANY_PARAMETER_NAME, COOPERATION_COMPANY_PARAMETER_VALUE,COOPERATION_COMPANY_ID, CREATE_USER_ID, CREATE_TIME, UPDATE_USER_ID, UPDATE_TIME) " +
            "VALUES " +
            "<foreach collection='list' item='item' index='index' separator=','>" +
            "(replace(uuid(),'-',''), #{item.cooperationCompanyParameterCode}, #{item.cooperationCompanyParameterName}, #{item.cooperationCompanyParameterValue}, #{item.cooperationCompanyId}, #{item.createUserId}, #{item.createTime}, #{item.updateUserId}, #{item.updateTime})" +
            "</foreach>" +
            "</script>")
    void insertCooperationCompanyParameter(@Param("list") List<CooperationCompanyParameter> cooperationCompanyParameterList);
}
